Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLIP] Validation Script #1181

Closed
wants to merge 1 commit into from
Closed

[CLIP] Validation Script #1181

wants to merge 1 commit into from

Conversation

dsikka
Copy link
Contributor

@dsikka dsikka commented Aug 14, 2023

Question - should this script include some sort of metric generation for zeroshot classification on some dataset? Right now, the script just takes in local samples

Summary

  • Validation script to run the CLIP Zeroshot and CLIP Caption generation pipelines
  • Both tasks are supported and the default task is Zeroshot classifiation
  • The script adds an extra layer where the user can provide text files with paths to images and sample classes. Examples of text files are provided in this PR: src/deepsparse/clip/sample_classes.txt and src/deepsparse/clip/sample_images.txt. Both are used as defaults

Testing

  • Tested locally using the following commands. The default sample_classes.txt was used and the sample_images.txt was updated to include the thailand.jpg (an image of elephants) from the yolact samples images.

Caption Generation:

python validation.py --task caption --decoder-model /home/dsikka/deepsparse/tests/deepsparse/pipelines/final_models/clip_text_decoder.onnx --text-model /home/dsikka/deepsparse/tests/deepsparse/pipelines/final_models/clip_text.onnx --visual-model /home/dsikka/deepsparse/tests/deepsparse/pipelines/final_models/clip_visual.onnx

Output:

Class prediction for /home/dsikka/deepsparse/src/deepsparse/yolact/sample_images/thailand.jpg, an adult elephant and a baby elephant 

Zeroshot Classification:

python validation.py --visual-model ~/deepsparse/tests/deepsparse/pipelines/zeroshot_research/visual/model.onnx --text-model ~/deepsparse/tests/deepsparse/pipelines/zeroshot_research/text/model.onnx

Output:

Class prediction for /home/dsikka/deepsparse/src/deepsparse/yolact/sample_images/thailand.jpg, an elephant

@dsikka dsikka marked this pull request as ready for review August 14, 2023 02:05
Copy link
Contributor

@bfineran bfineran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's refactor this so the main target is computing metrics for IC and capitoning. should support imagefolder style datasets for the former

@dsikka dsikka closed this Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants